package org.example.nuaael;

import cn.hutool.json.JSONUtil;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author : zhangbo
 * @data : 2024/6/20
 * @description :
 */
public class test2 {
    public static void main(String[] args) {
        String aaa="[{\n" +
                "  \"name\": \"随机生成的名字\",\n" +
                "  \"age\": 随机年龄,\n" +
                "  }]";
        Map<String,Object>map=new HashMap<>();
        List<Stu> list = JSONUtil.parseArray(aaa).toList(Stu.class);
        for (Stu stu : list) {
            String name = stu.getName();
            System.out.println(name);
        }
    }
}
